<template>
	<view>
<!-- 		<view class="cu-card dynamic" :class="isCard?'no-card':''" v-for="(item,i) in evaList" :key="i">
			<view class="cu-item shadow">
				<view class="cu-list menu-avatar">
					<view class="cu-item">
						<view class="content">
							<view class="text-sl">{{item.name}}</view>
						</view>
					</view>
				</view>
				<view class="text-content">
					{{ item.content }}
				</view>
				<view class="text-gray text-sm text-right padding">
					<button class="cu-btn round text-blue" @click="look(item.id)">查看</button>
				</view>
			</view>
		</view> -->
		<view class="cu-card dynamic" :class="isCard?'no-card':''" v-for="(item,i) in evaList" :key="i">
			<view class="cu-item shadow">
				<view class="cu-list menu-avatar">
					<view class="cu-item">
						<view class="content flex-sub">
							<view class="text-content text-sm flex justify-between">
								任务名称：{{item.title}}
							</view>
							<view>老师姓名：{{item.name}}</view>
							<view class="text-content">任务内容：{{item.taskContent}}</view>
						</view>
					</view>
				</view>
				<view class="text-content">
					解答：{{item.execContent}}
				</view>
				<view class="grid flex-sub padding-lr" :class="isCard?'col-3 grid-square':'col-1'">
					<image style="width: 300px; height: 300px; background-color: #eeeeee;" :src="item.picUrl"
						@error="imageError"></image>
				</view>
				<view class="grid flex-sub padding-lr" :class="isCard?'col-3 grid-square':'col-1'">
					<video id="myVideo" :src="item.videoUrl" @error="videoErrorCallback" controls></video>
				</view>
				<view class="grid flex-sub padding-lr" :class="isCard?'col-3 grid-square':'col-1'">
					<view class="text-content">成绩：{{ item.score }}分</view>
				</view>
				<view class="grid flex-sub padding-lr" :class="isCard?'col-3 grid-square':'col-1'">
					<view class="text-content">老师评价：{{ item.content }}</view>
				</view>
				<view class="text-gray text-sm text-right padding">
					<button class="cu-btn round text-blue" @click="look(item.id)">查看</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				evaList: []
			}
		},
		created() {
			this.getData();
		},
		methods: {
			getData() {
				let stuId = 1
				stuId = uni.getStorageSync('stuId');
				uni.request({
					url: 'http://localhost:8082/task_admin/evaluate/queryStuEvaluate?stuId=' + stuId,
					success: (res) => {
						if (res.data.code == 200) {
							this.evaList = res.data.data
						}
					}
				})
			},
			look(evaId) {
				uni.navigateTo({
					url: '/pages/student/evaluate-list-item?evaId=' + evaId
				});
			}
		}
	}
</script>

<style>
</style>
